package com.xiaohudie.JUC;

/**
 * @Author xiao hu die
 * @Date 2022/1/13 21:56
 * @Version 1.0
 */

import java.util.ArrayList;
import java.util.*;
/**List集合线程不安全*/
public class Thread05 {
    public static void main(String[] args) {
        List<String> stringList =new ArrayList<>();
        for (int i = 0; i < 10; i++) {
        new Thread(()->{
            stringList.add(UUID.randomUUID().toString().substring(0,7));
             System.out.println(stringList);

        },String.valueOf(i)).start();
        }
    }
}
